<?php
/**
*
* @author Blackpawn blackpawn666@hotmail.com - http://blackpawnsarchives.net
* @co_author GameCharmer admin@gamecharmer.com - http://gaming.gamecharmer.com
* @package Age of Dragons Mod :: ( Game Console Required )
* @version $Id: common.php 1.1.1 12-26-2009 Blackpawn
* @copyright (c) 2009 Blackpawns Archives
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('AOD'))
{
	exit;
}
require($phpbb_root_path . 'games/aod/includes/constants.' . $phpEx);
require($phpbb_root_path . 'games/aod/includes/functions.' . $phpEx);

// This formats the data through out the game
$date = date("M j Y g:i:s a");

$aod_config = array();

// Game Console Config
$sql = 'SELECT config_name, config_value
FROM ' . AOD_CONFIG_TABLE . '';
$result = $db->sql_query($sql);

while ($row = $db->sql_fetchrow($result))
{
	$aod_config[$row['config_name']] = $row['config_value'];
}
$db->sql_freeresult($result);	

// Fetch the Game ID
$game_id = gc_fetch_gid(GAME_PATH);

// Build game data list of all the games
$game = gc_fetch_games();

// Fetch the game name from the game data list
$game_name = $game[$game_id]['name'];

// Fetch the ticks left from the game data list
$ticks_left = $game[$game_id]['ticks_left'];

// Fetch the time mgt from the game data list
$game_time_mgt = $game[$game_id]['time_mgt'];

// Fetch the round length from the game data list
$game_round_length = $game[$game_id]['round_length'];

// Check to see if there is any game news bulletins
$game_bulletin = $game[$game_id]['bulletin'];

// Check to see if the game news bulletin should be shown or not
$game_bulletin_show = $game[$game_id]['bulletin_show'];

// Detect the amount of ticks in a day
$ticks_in_day = (floor(60 / $game_time_mgt) * 24);

// Detect the amount of days left
$days_left = floor($ticks_left / $ticks_in_day);

// Fetch the current round from the game data list
$game_round = $game[$game_id]['round'];

$news_page = FALSE;  	// Highlights the news tab
$kingdom_page = FALSE;  // Highlights the kingdom tab
$barracks_page = FALSE; // Highlights the barracks tab
$land_page = FALSE; 	// Highlights the land tab
$war_page = FALSE; 		// Highlights the war tab
$market_page = FALSE;	// Highlights the market tab
$shop_page = FALSE;		// Highlights the shop tab
$quests_page = FALSE;	// Highlights the quests tab
$guide_page = FALSE; 	// Highlights the guide tab
$ranks_page = FALSE; 	// Highlights the ranks tab
$admin_page = FALSE; 	// Highlights the admin tab

// Sync up the games member count
sync_member_count()
?>